<?php

class FV_TailleMin extends FormulaireValidatorImpl{
	
	private $limite = null;
	
	public function __construct($limite){
		
		$this->limite = $limite;
		$this->messageEchec = 'Taille inférieure à '.$this->limite.' charactères';
	}
	
	public function test($value){
		$strongness = 0;
		
		if(strlen(trim($value)) >= $this->limite){
			$strongness = 1;
		}
		
		return $strongness;
	}
	
	public function testJS(){
		?>
			
			
				if($(this).val().length < <?php echo $this->limite; ?>){
					alert("<?php echo $this->messageEchec; ?>");
				}
			
			
		<?php 
	}

}